package com.hfi.security.core.validate.code;

import org.springframework.web.context.request.ServletWebRequest;

/**
 * @author ChangLiang
 * @date 2019/9/1
 */
public interface ValidateCodeRepository {

    /**
     * 保存验证码 由于短信验证码和图片验证码session key不同 所以都要加ValidateCodeType
     *
     * @param request
     * @param validateCode
     */
    void save(ServletWebRequest request, ValidateCode validateCode, ValidateCodeType validateCodeType);

    /**
     * @param request
     * @return
     */
    ValidateCode get(ServletWebRequest request, ValidateCodeType validateCodeType);

    /**
     * 移除验证码
     *
     * @param request
     */
    void remove(ServletWebRequest request, ValidateCodeType validateCodeType);
}
